Add beginner topics and improve search discovery and loading - #25
Merged
Merged
Conversation
The graph on every page described only where a page sat: WebSite, WebPage and a BreadcrumbList. Nothing said what a page held, so a concept page and any other page looked like the same kind of thing to a crawler. Each concept now adds a DefinedTerm carrying the short definition, pointing at the MDN page for the same term through sameAs, and claiming membership of a DefinedTermSet that the home page declares over all thirty-five concepts. A TechArticle wraps the prose around it, with the proficiency level taken from the existing Fundamentals and Advanced split and the modified date from the same content commit the sitemap already uses. This matters more for assistants answering "what is a closure in JavaScript" than for blue links: a page that names itself the definition of a term is far easier to identify as the source than one that only names itself a page.
Consent already granted meant gtag.js and PostHog's array.js were injected the moment the module ran. Both are async, so neither blocked rendering, but a quarter of a megabyte of parse work competed with the main thread while it was still painting. Lighthouse put element render delay at 1.1s inside a mobile LCP of 3.8s, and 120 KiB of the two bundles never executed at all. Nothing either vendor does matters before the page is visible, and both are built to be started late: gtag buffers through dataLayer and PostHog through its _i stub queue. So the shims, the config call and the stub still run synchronously, and only the two script injections move behind an idle callback after load. The page view is still queued at the moment it happens rather than when the bundles land. The idle deadline is 1500ms: long enough to clear the paint, short enough that a quick bounce is still recorded. Safari below 16.4 has no requestIdleCallback and falls back to a timer, which by then is also clear of the paint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The reference was missing five common beginner topics, and concept pages downloaded the optional AI interface even when it stayed closed. This change adds arrays, objects, if/else, DOM, and events, and loads the AI panel only when opened.
All five new definitions stay under 30 words and include tested examples. The original 35 definitions and URLs are preserved. The homepage, navigation, and sitemap now cover 40 concepts.
Search and loading improvements:
The current master branch is merged in, preserving the newer README wording and Practice Pad link. Detailed maintenance notes live in docs/maintenance.md.
Validation: